import { ScaleSize, ScaleText } from 'react-native-scale-size'
import { Dimensions, PixelRatio, StatusBar, Platform } from 'react-native'

const { width, height } = Dimensions.get('window')
export const ScaleS = ScaleSize
export const ScaleT = ScaleText
export const WIDTH = width
export const HEIGHT = height
export const ONE_PIXEL = 1 / PixelRatio.get()
export const IS_IOS = Platform.OS === 'ios'
export const IS_ANDROID = Platform.OS !== 'ios'
export const IS_IPHONEX =
  IS_IOS &&
  ((WIDTH === 375 && HEIGHT === 812) || (WIDTH === 414 && HEIGHT === 896))
export const STATUSBAR_HEIGHT = IS_IOS
  ? IS_IPHONEX
    ? 44
    : 20
  : StatusBar.currentHeight
export const NAVIGATIONBAR_NAVIGATION_HEIGHT = 44
export const NAVIGATIONBAR_HEIGHT = STATUSBAR_HEIGHT + NAVIGATIONBAR_NAVIGATION_HEIGHT
export const NAVIGATIONBAR_BOTTOM_HEIGHT = IS_IPHONEX ? 83 : 49
